//
//  VMIXAppDelegate.m
//  VMIX
//
//  Created by jeffs on 5/14/10.
//  Copyright VMIX Media Inc. 2010. All rights reserved.
//

#import "VMIXAppDelegate.h"
#import "RootViewController.h"
#import "DetailViewController.h"






@implementation VMIXAppDelegate

@synthesize window, splitViewController, rootViewController, detailViewController;


#pragma mark -
#pragma mark Application lifecycle

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    
	// Add the split view controller's view to the window and display.
	[window addSubview:splitViewController.view];
    [window makeKeyAndVisible];
	[self performSelector:@selector(fixRoundedSplitViewCorner) withObject:NULL afterDelay:0];
	return YES;
}


/** 
 applicationWillTerminate: saves changes in the application's managed object context before the application terminates.
 */
- (void)applicationWillTerminate:(UIApplication *)application {
	
    
	
	
}

- (void) explode:(id)aView level:(int)level
{
	if ([aView isKindOfClass:[UIImageView class]]) {
		UIImageView* roundedCornerImage = (UIImageView*)aView;
		roundedCornerImage.hidden = YES;
	}
	if (level < 2) {
		for (UIView *subview in [aView subviews]) {
			[self explode:subview level:(level + 1)];
		}
	}
}

- (void) fixRoundedSplitViewCorner
{
    [self explode:[[UIApplication sharedApplication] keyWindow] level:0];
}

/**
 * implement GetCollectionsOperationDelegate
 */
- (void)didFinishParsingCollections:(NSMutableArray *)collectionsArray 
{
    // do nothing here
}

#pragma mark -
#pragma mark Memory management

- (void)dealloc {
    
	[splitViewController release];
	[rootViewController release];
	[detailViewController release];

	[window release];
	[super dealloc];
}


@end

